home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 November / Chip 11-96.iso / workshop / howto / sound < prev    next >
Text File  |  1996-05-25  |  31KB  |  952 lines

  1.   The Linux Sound HOWTO
  2.   Jeff Tranter, Jeff_Tranter@Mitel.COM
  3.   v1.6, 6 June 1994
  4.  
  5.   This document describes sound support for Linux. It lists the sup-
  6.   ported sound hardware, describes how to configure the kernel drivers,
  7.   and answers frequently asked questions. The intent is to bring new
  8.   users up to speed more quickly and reduce the amount of traffic in the
  9.   usenet news groups.
  10.  
  11.   1.  Introduction
  12.  
  13.  
  14.   This is the Linux Sound HOWTO document. It is intended as a quick
  15.   reference covering everything you need to know to install and
  16.   configure sound support under Linux. Frequently asked questions about
  17.   sound under Linux are answered, and references are given to some other
  18.   sources of information on a variety of topics related to computer
  19.   generated sound and music.
  20.  
  21.   The scope is limited to the aspects of sound cards pertaining to
  22.   Linux. See the other documents listed in the Other Sources of
  23.   Information section for more general information on sound cards and
  24.   computer sound and music generation.
  25.  
  26.  
  27.   1.1.  Acknowledgments
  28.  
  29.  
  30.   Much of this information came from the Readme files provided with the
  31.   sound driver source code, by Hannu Savolainen (hannu@voxware.pp.fi).
  32.   Thanks go to Hannu and the many other people who developed the Linux
  33.   kernel sound drivers and utilities.
  34.  
  35.   Thanks to Matt Welsh's Linuxdoc-SGML package, this HOWTO is now
  36.   available in several formats, all generated from a common source file.
  37.  
  38.  
  39.   1.2.  Revision History
  40.  
  41.  
  42.  
  43.      Version 1.1
  44.         first version; posted to SOUND channel of Linux activists
  45.         mailing list only
  46.  
  47.      Version 1.2
  48.         minor updates; first version available on archive sites
  49.  
  50.      Version 1.3
  51.         converted to SGML; now available in several formats using Matt
  52.         Welsh's Linuxdoc-SGML tools; appearance changed due to new
  53.         format, only minor changes to content
  54.  
  55.      Version 1.4
  56.         minor tweaking of SGML; added answer on PAS16 and Adaptec1542A
  57.         SCSI adaptor incompatibilities
  58.  
  59.      Version 1.5
  60.         2.5a sound driver is now in 1.1 kernel distribution; note on
  61.         GUS-MAX support; other minor updates
  62.  
  63.      Version 1.6
  64.         added info on "no space on device" error; added note that
  65.         Hacker's Guide is in a "hidden" directory; added question on
  66.         bidirectional mode; info on "device busy" errors; other minor
  67.         changes
  68.  
  69.  
  70.   1.3.  New versions of this document
  71.  
  72.  
  73.   New versions of this document will be periodically posted to
  74.   comp.os.linux.announce. They will also be uploaded to various
  75.   anonymous ftp sites that archive such information including
  76.   sunsite.unc.edu:/pub/Linux/docs/HOWTO.
  77.  
  78.  
  79.   1.4.  Feedback
  80.  
  81.  
  82.   If you have any suggestions, corrections, or comments on the HOWTO,
  83.   please send them to the author and I will try to incorporate them in
  84.   the next release.
  85.  
  86.  
  87.   1.5.  Other Sources of Information
  88.  
  89.  
  90.   The Linux Sound User's Guide covers all of the user visible aspects of
  91.   using sound under Linux in much more detail (approximately 40 pages).
  92.   If you are interested in sound under Linux you should definitely get
  93.   this document. The current version is ALPHA 0.1, and is available on
  94.   tsx-11.mit.edu in the directory /pub/linux/ALPHA/LDP. I will continue
  95.   to maintain the Sound-HOWTO as a concise guide for users who want to
  96.   get sound up and running, or just find out what is required, without
  97.   having to read the full user's guide.
  98.  
  99.   Hannu Savolainen has written a draft version of the Hacker's Guide to
  100.   VoxWare. The latest version is draft 2, and can be found on
  101.   nic.funet.fi in /pub/OS/linux/ALPHA/sound.
  102.  
  103.   The following FAQs are regularly posted to the usenet newsgroup
  104.   news.announce as well as being archived at the site rtfm.mit.edu in
  105.   the directory /pub/usenet/news.answers:
  106.  
  107.  
  108.   PCsoundcards/generic-faq (Generic PC Soundcard FAQ)
  109.   PCsoundcards/soundcard-faq (comp.sys.ibm.pc.soundcard FAQ)
  110.   PCsoundcards/gravis-ultrasound/faq (Gravis UltraSound FAQ)
  111.   audio-fmts/part1 (Audio file format descriptions)
  112.   audio-fmts/part2 (Audio file format descriptions)
  113.  
  114.  
  115.  
  116.   The FAQs also list several product specific mailing lists and archive
  117.   sites. The following Usenet news groups discuss sound and/or music
  118.   related issues:
  119.  
  120.  
  121.   alt.binaries.sounds.* (various groups for posting sound files)
  122.   alt.binaries.multimedia (discussions on Multimedia)
  123.   alt.sb.programmer (Soundblaster programming topics)
  124.   comp.multimedia (Multimedia topics)
  125.   comp.music (Computer music theory and research)
  126.   comp.sys.ibm.pc.soundcard (IBM PC soundcard topics)
  127.  
  128.  
  129.  
  130.   The Linux Activists mailing list has a SOUND channel. To find out how
  131.   to join the mailing list, send mail to linux-activists-
  132.   request@joker.cs.hut.fi.
  133.   The files Readme, Readme.linux, and CHANGELOG included with the kernel
  134.   sound driver source code contain useful information about the sound
  135.   card drivers. These can typically be found in the directory
  136.   /usr/src/linux/drivers/sound.
  137.  
  138.   The Linux Software Map (LSM) is an invaluable reference for locating
  139.   Linux software. Searching the LSM for keywords such as sound is a good
  140.   way to identify applications related to sound hardware. The LSM can be
  141.   found on various anonymous FTP sites, including
  142.   sunsite.unc.edu:/pub/Linux/docs/LSM.gz.
  143.  
  144.  
  145.   1.6.  Version Information
  146.  
  147.  
  148.   At time of writing the latest Linux sound driver was version 2.5a, and
  149.   was included in the Linux kernel version 1.1.10 and later. You can
  150.   also obtain the 2.5 sound driver separately, and apply it as a patch
  151.   to earlier kernels (such as 1.0).
  152.  
  153.  
  154.   2.  Supported Sound Hardware
  155.  
  156.   2.1.  Sound Cards
  157.  
  158.  
  159.   The following sound cards are supported by the Linux kernel:
  160.  
  161.  
  162.   o  Roland MPU-401 MIDI interface
  163.  
  164.   o  AdLib
  165.  
  166.   o  SoundBlaster (version 1 and 2) and compatibles, including
  167.      ThunderBoard and ATI Stereo F/X
  168.  
  169.   o  SoundBlaster Pro (version 1 and 2)
  170.  
  171.   o  SoundBlaster 16
  172.  
  173.   o  ProAudioSpectrum 16 (and the compatible Logitech SoundMan 16)
  174.  
  175.   o  Advanced Gravis UltraSound (GUS)
  176.  
  177.   Other sound cards that are claimed to be compatible with one of the
  178.   supported sound cards may work if they are hardware (i.e. register
  179.   level) compatible.
  180.  
  181.   The Sound Galaxy NX Pro is supported as a SoundBlaster compatible,
  182.   provided that you add #define __SGNXPRO__ to the sound driver local.h
  183.   file.
  184.  
  185.   The Linux kernel supports the SCSI port provided on some sound cards
  186.   (e.g. ProAudioSpectrum 16). There is also support for CD-ROM drives
  187.   attached to the Soundblaster Pro and SoundBlaster 16 CD-ROM port (see
  188.   the file /usr/src/linux/drivers/block/README.sbpcd).
  189.  
  190.   A kernel patch to support joystick ports, including those provided on
  191.   some sound cards, is also available.
  192.  
  193.  
  194.   2.2.  PC Speaker
  195.  
  196.  
  197.   An alternate sound driver is available that requires no additional
  198.   sound hardware; it uses the internal PC speaker. It is mostly software
  199.   compatible with the sound card driver, but, as might be expected,
  200.   provides much lower quality output and has much more CPU overhead. The
  201.   results seem to vary, being dependent on the characteristics of the
  202.   individual loudspeaker. For more information, see the documentation
  203.   provided with the release.
  204.  
  205.   The current version is 0.6, and can be found at site sunsite.unc.edu
  206.   in the file pub/Linux/kernel/misc-patches/pcsndrv-0.6.tar.z.
  207.  
  208.  
  209.   2.3.  Parallel Port
  210.  
  211.  
  212.   Another option is to build a digital to analog converter using a
  213.   parallel printer port. This provides better sound quality but still
  214.   has a lot of CPU overhead. The PC sound driver package mentioned above
  215.   supports this, and includes instructions for building the necessary
  216.   hardware.
  217.  
  218.  
  219.   3.  Configuring Linux for Sound Support
  220.  
  221.  
  222.   Configuring Linux to support sound involves the following steps:
  223.  
  224.  
  225.   1. Installing the sound card.
  226.  
  227.   2. Configuring and building the kernel for sound support.
  228.  
  229.   3. Creating the device files.
  230.  
  231.   4. Testing the installation.
  232.  
  233.  
  234.   3.1.  Installing the Sound Card
  235.  
  236.  
  237.   To install the card, follow the instructions provided by the
  238.   manufacturer. Be sure to note down the jumper settings for IRQ, DMA
  239.   channel, etc. If you are unsure, use the factory defaults. Try to
  240.   avoid conflicts with other devices (e.g. ethernet cards, SCSI host
  241.   adaptors) if possible.
  242.  
  243.  
  244.   3.2.  Configuring the Kernel
  245.  
  246.  
  247.   If you are using a recent kernel (0.99pl14 or later), the sound
  248.   drivers are included with the kernel release. Follow the usual
  249.   procedure for building the kernel. When you run make config, a
  250.   configuration program will ask you what sound card options you want.
  251.   Carefully read the information displayed by this program.
  252.  
  253.   If you are upgrading from an older sound driver, make sure that the
  254.   files /usr/include/sys/soundcard.h and /usr/include/sys/ultrasound.h
  255.   are symbolic links to the corresponding files in /usr/include/linux.
  256.  
  257.   It's good idea to read the Readme files in the kernel drivers/sound
  258.   directory since there could be some last minute information. The file
  259.   CHANGELOG contains a list of enhancements and new features since the
  260.   previous version.
  261.  
  262.  
  263.  
  264.  
  265.   3.3.  Creating the Device Files
  266.  
  267.  
  268.   The first time the kernel sound driver is configured, you need to
  269.   create the sound device files. The easiest way to do this is to cut
  270.   the short shell script from the end of the file Readme.linux (or
  271.   possibly Readme) in the directory /usr/src/linux/drivers/sound, and
  272.   run it as root.
  273.  
  274.   If your device entries already exist, you might want to ensure they
  275.   are correct, e.g. /dev/audio should have major and minor device
  276.   numbers 14 and 4. If they are not, or if you are in doubt, run the
  277.   above script and it will replace any existing entries with correct
  278.   ones.
  279.  
  280.   Some older Linux distributions provided install scripts which created
  281.   incorrect sound device files. You may also have a /dev/MAKEDEV script
  282.   for creating device files. Using the script included with the kernel
  283.   sound driver is preferred since it should always be up to date with
  284.   the latest supported sound devices.
  285.  
  286.  
  287.   3.4.  Testing the Installation
  288.  
  289.  
  290.   You can now follow these steps to verify the sound hardware and
  291.   software:
  292.  
  293.   1. Reboot with the new kernel.
  294.  
  295.   Follow your usual procedure for installing and rebooting the new
  296.   kernel (keep the old kernel around in case of problems, of course).
  297.  
  298.   2. Verify that the sound card is recognized during kernel
  299.   initialization.
  300.  
  301.   Check for a message such as the following on powerup (if they scroll
  302.   by too quickly to read, you may be able to retrieve them with the
  303.   "dmesg" command):
  304.  
  305.  
  306.  
  307.        ______________________________________________________________________
  308.        snd2 <SoundBlaster Pro 3.2> at 0x220 irq 5 drq 1
  309.        snd1 <Yamaha OPL-3 FM> at 0x388 irq 0 drq 0
  310.        ______________________________________________________________________
  311.  
  312.  
  313.  
  314.  
  315.   This should match your sound card type and jumper settings.
  316.  
  317.   The driver may also display some error messages and warnings during
  318.   boot. Watch for these when booting the first time after configuring
  319.   the sound driver.
  320.  
  321.   If no sound card is detected when booting, there are two possible
  322.   reasons:
  323.  
  324.  
  325.   o  The configuration of the driver is incorrect and the driver was not
  326.      able to detect your card in the given I/O address, or
  327.  
  328.   o  The sound driver was configured to be inactive or you booted with
  329.      an old kernel (a common error).
  330.  
  331.   3. Check device file /dev/sndstat.
  332.  
  333.   Reading the sound driver status device file should provide additional
  334.   information on whether the sound card driver initialized properly.
  335.   Sample output should look something like this:
  336.  
  337.  
  338.  
  339.        ______________________________________________________________________
  340.        % cat /dev/sndstat
  341.  
  342.        Sound Driver:2.5 (Wed Apr 20 19:57:25 EDT 1994 root@fizzbin)
  343.        Config options: 1aa2
  344.  
  345.        HW config:
  346.        Type 2: SoundBlaster at 0x220 irq 5 drq 1
  347.        Type 1: AdLib at 0x388 irq 0 drq 0
  348.  
  349.        PCM devices:
  350.        0: SoundBlaster Pro 3.2
  351.  
  352.        Synth devices:
  353.        0: Yamaha OPL-3
  354.  
  355.        Midi devices:
  356.        0: SoundBlaster
  357.  
  358.        Mixer(s) installed
  359.        ______________________________________________________________________
  360.  
  361.  
  362.  
  363.  
  364.   If the cat command displays "No such device", the sound driver is not
  365.   active in the kernel. Make sure that you booted with the newly
  366.   compiled kernel.
  367.  
  368.   If the printout contains no devices (PCM, Synth or MIDI), your
  369.   soundcard was not detected. Verify that the "HW config" section
  370.   contains correct information.
  371.  
  372.   4. Play a simple sound file.
  373.  
  374.   Get hold of a sample sound file, and send it to the sound device as a
  375.   basic check of sound output, e.g.
  376.  
  377.  
  378.  
  379.        ______________________________________________________________________
  380.        % cat endoftheworld >/dev/dsp
  381.        % cat crash.au >/dev/audio
  382.        ______________________________________________________________________
  383.  
  384.  
  385.  
  386.  
  387.   Some sample sound files can be obtained from the file snd-
  388.   data-0.1.tar.Z.
  389.  
  390.   5. Verify sound recording.
  391.  
  392.   If you have sound input capability, you can do a quick test of this
  393.   using commands such as the following:
  394.  
  395.  
  396.  
  397.   ______________________________________________________________________
  398.   # record 4 seconds of audio from microphone
  399.   % dd bs=8k count=4 </dev/audio >sample.au
  400.   # play back sound
  401.   % cat sample.au >/dev/audio
  402.   ______________________________________________________________________
  403.  
  404.  
  405.  
  406.  
  407.   If these tests pass, you can be reasonably confident that the sound
  408.   hardware and software are working. If you experience problems, read
  409.   the FAQ section of this document.
  410.  
  411.  
  412.   4.  Applications Supporting Sound
  413.  
  414.  
  415.   Because The Linux Sound User's Guide describes the available Linux
  416.   applications in detail, I will only give here a sample of the types of
  417.   applications that you likely want if you have a sound card under
  418.   Linux.
  419.  
  420.   As a minimum, you will likely want to obtain the following sound
  421.   applications:
  422.  
  423.  
  424.   o  audio file format conversion utility (e.g. Sox)
  425.  
  426.   o  mixer utility (e.g. aumix or xmix)
  427.  
  428.   o  digitized file player/recorder (e.g. play)
  429.  
  430.   o  MOD file player (e.g. tracker)
  431.  
  432.   o  MIDI file player (e.g. mp)
  433.  
  434.   There are text-based as well as GUI-based versions of most of these
  435.   tools. There are also some more esoteric applications (e.g. speech
  436.   synthesis) that you may wish to try.
  437.  
  438.  
  439.   5.  Answers To Frequently Asked Questions
  440.  
  441.  
  442.   This section answers some of the questions that have been commonly
  443.   asked on the Usenet news groups and mailing lists.
  444.  
  445.  
  446.   5.1.  What are the various sound device files?
  447.  
  448.  
  449.  
  450.      /dev/audio
  451.         Sun workstation compatible audio device (only a partial
  452.         implementation, does not support Sun ioctl interface, just u-law
  453.         encoding)
  454.  
  455.      /dev/dsp
  456.         digital sampling device
  457.  
  458.      /dev/mixer
  459.         sound mixer
  460.  
  461.      /dev/sequencer
  462.         MIDI, FM, and GUS access
  463.      /dev/midi
  464.         MIDI device (not yet implemented in current sound driver)
  465.  
  466.      /dev/sndstat
  467.         displays sound driver status when read
  468.  
  469.      /dev/audio1
  470.         for second sound card
  471.  
  472.      /dev/dsp1
  473.         for second sound card
  474.  
  475.   The PC speaker driver provides the following devices:
  476.  
  477.  
  478.      /dev/pcaudio
  479.         equivalent to /dev/audio
  480.  
  481.      /dev/pcsp
  482.         equivalent to /dev/dsp
  483.  
  484.      /dev/pcmixer
  485.         equivalent to /dev/mixer
  486.  
  487.  
  488.   5.2.  How can I play a sound sample?
  489.  
  490.  
  491.   Sun workstation (.au) sound files can be played by sending them to the
  492.   /dev/audio device. Raw samples can be sent to /dev/dsp. Using a
  493.   program such as play is preferable, as it will recognize most file
  494.   types and set the sound card to the correct sampling rate, etc.
  495.  
  496.  
  497.   5.3.  How can I record a sample?
  498.  
  499.  
  500.   Reading /dev/audio or /dev/dsp will return sampled data that can be
  501.   redirected to a file. A program such as vrec makes it easier to
  502.   control the sampling rate, duration, etc. You may also need a mixer
  503.   program to select the appropriate input device.
  504.  
  505.  
  506.   5.4.  Can I have more than one sound card?
  507.  
  508.  
  509.   Up to two sound cards is supported. It's possible to install a Gravis
  510.   UltraSound or MPU-401 with a SoundBlaster, SoundBlaster Pro,
  511.   SoundBlaster16 or ProAudioSpectrum16. It's not possible to have a
  512.   ProAudioSpectrum16 and SoundBlaster at the same time (the PAS16 has an
  513.   SB emulator in it). It's also not possible to have more than one card
  514.   of the same type at the same time -- for example, a GUS + GUS
  515.   combination is not possible.
  516.  
  517.   You can change the sound card configuration parameters at boot time
  518.   using command line options from a boot loader such as LILO. See the
  519.   kernel sound driver file Readme.linux for details.
  520.  
  521.  
  522.   5.5.  Error: No such file or directory for sound devices
  523.  
  524.  
  525.   You need to create the sound driver device files. See the section on
  526.   creating device files. If you do have the device files, ensure that
  527.   they have the correct major and minor device numbers (some older CD-
  528.   ROM distributions of Linux may not create the correct device files
  529.   during installation).
  530.  
  531.  
  532.   5.6.  Error: No such device for sound devices
  533.  
  534.  
  535.   You have not booted with a kernel containing the sound driver or the
  536.   I/O address configuration doesn't match your hardware. Check that you
  537.   are running the newly compiled kernel and verify that the settings
  538.   entered when configuring the sound driver match your hardware setup.
  539.  
  540.  
  541.   5.7.  Error: No space left on device for sound devices
  542.  
  543.  
  544.   This can happen if you tried to record data to /dev/audio or /dev/dsp
  545.   without creating the necessary device file. The sound device is now a
  546.   regular file, and has filled up your disk partition. You need to run
  547.   the script described in the Creating the Device Files section of this
  548.   document.
  549.  
  550.  
  551.   5.8.  Error: device busy for sound devices
  552.  
  553.  
  554.   Only one process can open a given sound device at one time. Most
  555.   likely some other process is using the device in question. One way to
  556.   determine this is to use the fuser command:
  557.  
  558.  
  559.  
  560.        ______________________________________________________________________
  561.        % fuser -v /dev/dsp
  562.        /dev/dsp:             USER       PID ACCESS COMMAND
  563.                              tranter    265 f....  tracker
  564.        ______________________________________________________________________
  565.  
  566.  
  567.  
  568.  
  569.   In the above example, the fuser command showed that process 265 had
  570.   the device open. Waiting for the process to complete or killing it
  571.   will allow the sound device to be accessed once again.
  572.  
  573.  
  574.   5.9.  I still get device busy errors!
  575.  
  576.  
  577.   (the following explanation was supplied by Harald Albrecht
  578.   albrecht@igpm.rwth-aachen.de)
  579.  
  580.   Some soundcards support using DMA channel 0. The sound driver
  581.   configuration program allows this, and the kernel compiles properly,
  582.   but accessing the sound device results in a "device busy" error
  583.   message.
  584.  
  585.   The reason is that the Linux kernel reserves DMA channel 0 for DRAM
  586.   refresh. This is no longer true for modern 386/486 boards which use
  587.   their own refresh logic. You can correct it by changing this line in
  588.   the file /usr/src/linux/kernel/dma.c:
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.   ______________________________________________________________________
  596.   static volatile unsigned int dma_chan_busy[MAX_DMA_CHANNELS] = {
  597.                   1, 0, 0, 0, 1, 0, 0, 0
  598.   };
  599.   ______________________________________________________________________
  600.  
  601.  
  602.  
  603.  
  604.   Replace the first 1 with a 0; this enables DMA channel 0. Don't do the
  605.   same with DMA channel 4 as this is cascade and won't work! The code
  606.   should now look like this:
  607.  
  608.  
  609.  
  610.        ______________________________________________________________________
  611.        static volatile unsigned int dma_chan_busy[MAX_DMA_CHANNELS] = {
  612.                        0, 0, 0, 0, 1, 0, 0, 0
  613.        };
  614.        ______________________________________________________________________
  615.  
  616.  
  617.  
  618.  
  619.   Recompile and reboot with the new kernel.
  620.  
  621.  
  622.   5.10.  Partial playback of digitized sound file
  623.  
  624.  
  625.   The symptom is usually that a sound sample plays for about a second
  626.   and then stops completely or reports an error message about "missing
  627.   IRQ" or "DMA timeout". Most likely you have incorrect IRQ or DMA
  628.   channel settings. Verify that the kernel configuration matches the
  629.   sound card jumper settings and that they do not conflict with some
  630.   other card.
  631.  
  632.  
  633.   5.11.  There are pauses when playing MOD files
  634.  
  635.  
  636.   Playing MOD files requires considerable CPU power. You may have too
  637.   many processes running or your computer may be too slow to play in
  638.   real time. Your options are to:
  639.  
  640.  
  641.   o  try playing with a lower sampling rate or in mono mode
  642.  
  643.   o  eliminate other processes
  644.  
  645.   o  buy a faster computer
  646.  
  647.   o  buy a more powerful sound card (e.g. Gravis UltraSound)
  648.  
  649.  
  650.   5.12.  Compile errors when compiling sound applications
  651.  
  652.  
  653.   The version 1.0c and earlier sound driver used a different and
  654.   incompatible ioctl() scheme. Obtain newer source code or make the
  655.   necessary changes to adapt it to the new sound driver. See the sound
  656.   driver Readme file for details.
  657.  
  658.   Also ensure that you have used the latest version of soundcard.h and
  659.   ultrasound.h when compiling the application. See the installation
  660.   instructions at beginning of this text.
  661.   5.13.  SEGV when running sound binaries that worked previously
  662.  
  663.  
  664.   This is probably the same problem described in the previous question.
  665.  
  666.  
  667.   5.14.  What known bugs or limitations are there in the sound driver?
  668.  
  669.  
  670.   See the Readme and CHANGELOG files included with the sound driver
  671.   kernel source.
  672.  
  673.  
  674.   5.15.  What version of the sound driver I should use?
  675.  
  676.  
  677.   If you are using version 1.0c or earlier, you definitely need to
  678.   upgrade. Version 1.0c is not compatible with the applications written
  679.   for version 2.0 or later.
  680.  
  681.   There have been no significant changes after version 2.0, so if you
  682.   don't have problems and that particular version fulfills your
  683.   requirements, there are no compelling reasons to move to a more recent
  684.   version (this should be true at least until September 1994).
  685.  
  686.   The latest official version is in the latest Linux kernel
  687.   distribution. There may also be some test and prototype versions lying
  688.   around. If the version number is smaller than 2.9, the version should
  689.   be quite safe. Any driver release having a version number of the form
  690.   2.99.XX is an incompletely implemented and experimental test release.
  691.  
  692.   If you are interested in development of the sound driver, join the
  693.   linux activists SOUND channel.
  694.  
  695.  
  696.   5.16.  What do all the sound driver configuration options mean?
  697.  
  698.  
  699.   During configuration of the sound driver, a configure program is
  700.   compiled and executed. This program asks you some questions and then
  701.   generates the header file local.h that defines the sound card
  702.   configuration.
  703.  
  704.   The configuration file defines (or undefines) the following symbols:
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.   Symbol                  Meaning
  728.   ======                  =======
  729.   KERNEL_SOUNDCARD        enable/disable sound driver
  730.   CONFIGURE_SOUNDCARD     enable/disable sound driver
  731.   EXCLUDE_PAS             ProAudioSpectrum support
  732.   EXCLUDE_SB              SoundBlaster support
  733.   EXCLUDE_ADLIB           AdLib support
  734.   EXCLUDE_GUS             Gravis UltraSound support
  735.   EXCLUDE_MPU401          MPU-401 MIDI interface support
  736.   EXCLUDE_SBPRO           SoundBlaster Pro support
  737.   EXCLUDE_SB16            SoundBlaster 16 support
  738.   EXCLUDE_AUDIO           Digitized voice support
  739.   EXCLUDE_MIDI            MIDI interface support
  740.   EXCLUDE_YM3812          FM synthesizer (YM3812/OPL-3) support
  741.   EXCLUDE_SEQUENCER       MIDI sequencer support
  742.   EXCLUDE_PRO_MIDI        SoundBlaster Pro MIDI support
  743.   EXCLUDE_CHIP_MIDI       MIDI on CHIP support
  744.   SBC_IRQ                 SoundBlaster IRQ number
  745.   SBC_DMA                 SoundBlaster DMA channel
  746.   SB16_DMA                SoundBlaster 16 DMA channel
  747.   SB16_MIDI_BASE          base address of SoundBlaster 16 MIDI port
  748.   PAS_IRQ                 ProAudioSpectrum IRQ number
  749.   PAS_DMA                 ProAudioSpectrum DMA channel
  750.   GUS_IRQ                 Gravis UltraSound IRQ number
  751.   GUS_DMA                 Gravis UltraSound DMA channel
  752.   GUS_BASE                base address of Gravis UltraSound
  753.   MPU_IRQ                 MPU-401 IRQ number
  754.   MPU_BASE                base address of MPU-401 port
  755.   DSP_BUFFSIZE            DMA buffer size
  756.  
  757.  
  758.  
  759.   Several other defines are also created, setting such things as the
  760.   sound driver revision level and the time and date when configure was
  761.   run.
  762.  
  763.   There are other parameters that are not set by the configure program
  764.   (e.g. SoundBlaster base address). If you need to change these, edit
  765.   the file sound_config.h.
  766.  
  767.   To disable the sound driver, run make config and answer "no" to the
  768.   "Sound card support?" question.
  769.  
  770.  
  771.   5.17.  What future enhancements are planned for the sound driver?
  772.  
  773.  
  774.   The sound driver is not just for Linux, it also supports several other
  775.   Intel-based Unix operating systems. The package is now called
  776.   "VoxWare". Some of the enhancements being considered are:
  777.  
  778.  
  779.   o  implementing full MIDI support
  780.  
  781.   o  patch manager support
  782.  
  783.   o  document sound card driver (Hacker's Guide)
  784.  
  785.   o  support for new sound cards
  786.  
  787.   o  miscellaneous bug fixes
  788.  
  789.  
  790.  
  791.  
  792.  
  793.   5.18.  Where are the sound driver ioctls() etc. documented?
  794.  
  795.  
  796.   These are documented in the Hacker's Guide to VoxWare, currently
  797.   available in draft form. The latest version is draft 2, and can be
  798.   found on nic.funet.fi in /pub/OS/linux/ALPHA/sound. Note that this
  799.   directory is "hidden" and will not appear in directory listings. If
  800.   you "cd" to the directory and use the FTP "dir" command, the files are
  801.   there.
  802.  
  803.  
  804.   5.19.  What CPU resources are needed to play or record without pauses?
  805.  
  806.  
  807.   There is no easy answer to this question, as it depends on:
  808.  
  809.  
  810.   o  whether using PCM sampling or FM synthesis
  811.  
  812.   o  sampling rate and sample size
  813.  
  814.   o  which application is used to play or record
  815.  
  816.   o  Sound Card hardware
  817.  
  818.   o  disk I/O rate, CPU clock speed, cache size, etc.
  819.  
  820.   In general, any 386 machine should be able to play samples or FM
  821.   synthesized music on an 8 bit soundcard with ease.
  822.  
  823.   Playing MOD files, however, requires considerable CPU resources. Some
  824.   experimental measurements have shown that playing at 44kHz requires
  825.   more than 40% of the speed of a 486/50 and a 386/25 can hardly play
  826.   faster than 22 kHz (these are with an 8 bit card sound such as a
  827.   SoundBlaster). A card such as the Gravis UltraSound card performs more
  828.   functions in hardware, and will require less CPU resources.
  829.  
  830.   These statements assume the computer is not performing any other CPU
  831.   intensive tasks.
  832.  
  833.   Converting sound files or adding effects using a utility such as Sox
  834.   is also much faster if you have a math coprocessor. The kernel driver
  835.   itself does not do any floating point calculations, though.
  836.  
  837.  
  838.   5.20.  Problems with a PAS16 and an Adaptec 1542 SCSI host adaptor
  839.  
  840.  
  841.   (the following explanation was supplied by seeker@indirect.com)
  842.  
  843.   Linux only recognizes the 1542 at address 330 (default) or 333, and
  844.   the PAS only allows the MPU-401 emulation at 330.  Even when you
  845.   disable the MPU-401 under software, something still wants to conflict
  846.   with the 1542 if it's at its preferred default address.  Moving the
  847.   1542 to 333 makes everyone happy.
  848.  
  849.  
  850.   Additionally, both the 1542 and the PAS-16 do 16-bit DMA, so if you
  851.   sample at 16-bit 44KHz stereo and save the file to a SCSI drive hung
  852.   on the 1542, you're about to have trouble.  The DMAs overlap and there
  853.   isn't enough time for RAM refresh, so you get the dread ``PARITY ERROR
  854.   - SYSTEM HALTED'' message, with no clue to what caused it.  It's made
  855.   worse because a few second-party vendors with QIC-117 tape drives
  856.   recommend setting the bus on/off times such that the 1542 is on even
  857.   longer than normal.  Get the SCSISEL.EXE program from Adaptec's BBS or
  858.   several places on the internet, and reduce the BUS ON time or increase
  859.   the BUS OFF time until the problem goes away, then move it one notch
  860.   or more further.  SCSISEL changes the EEPROM settings, so it's more
  861.   permanent than a patch to the DOS driver line in CONFIG.SYS, and will
  862.   work if you boot right into Linux (unlike the DOS patch).  Next
  863.   problem solved.
  864.  
  865.  
  866.   Last problem - the older Symphony chipsets drastically reduced the
  867.   timing of the I/O cycles to speed up bus accesses.  None of various
  868.   boards I've played with had any problem with the reduced timing except
  869.   for the PAS-16.  Media Vision's BBS has SYMPFIX.EXE that's supposed to
  870.   cure the problem by twiddling a diagnostic bit in Symphony's bus
  871.   controller, but it's not a hard guarantee.  You may need to:
  872.  
  873.  
  874.   o  get the motherboard distributor to replace the older version bus
  875.      chip,
  876.  
  877.   o  replace the motherboard, or
  878.  
  879.   o  buy a different brand of sound card.
  880.  
  881.   Young Microsystems will upgrade the boards they import for around $30
  882.   (US); other vendors may be similar if you can figure out who made or
  883.   imported the motherboard (good luck).  The problem is in ProAudio's
  884.   bus interface chip as far as I'm concerned; nobody buys a $120 sound
  885.   card and sticks it in a 6MHz AT.  Most of them wind up in 25-40MHz
  886.   386/486 boxes, and should be able to handle at least 12MHz bus rates
  887.   if the chips are designed right. Exit soapbox (stage left).
  888.  
  889.  
  890.   The first problem depends on the chipset used on your motherboard,
  891.   what bus speed and other BIOS settings, and the phase of the moon.
  892.   The second problem depends on your refresh option setting (hidden or
  893.   synchronous), the 1542 DMA rate and (possibly) the bus I/O rate.  The
  894.   third can be determined by calling Media Vision and asking which
  895.   flavor of Symphony chip is incompatible with their slow design.  Be
  896.   warned, though - 3 of 4 techs I talked to were brain damaged.  I would
  897.   be very leery of trusting anything they said about someone else's
  898.   hardware, since they didn't even know their own very well.
  899.  
  900.  
  901.  
  902.   5.21.  Problems with the FM synthesizer on a SoundBlaster Pro 1
  903.  
  904.  
  905.   The newer SB Pro has an OPL-3 FM chip, but the older version 1 used
  906.   the OPL-2. The sound driver assumed the presence of an OPL-3. Version
  907.   2.5 of the sound driver corrects this problem.
  908.  
  909.  
  910.   5.22.  Is the GUS-MAX supported?
  911.  
  912.  
  913.   The GUS-MAX is not explicitly supported yet, but it will work
  914.   partially with the current sound driver. The driver does not know
  915.   about the additions such as the mixer or 16 bit sampling. Booting your
  916.   system and initializing the card under MS-DOS and then booting Linux
  917.   (using ctrl-alt-del) should allow it to work.
  918.  
  919.   Full GUS-MAX (and GUS + 16 bit daughtercard) support should be
  920.   provided in the kernel driver in the near future.
  921.  
  922.  
  923.  
  924.  
  925.   5.23.  What if my sound card is not supported?
  926.  
  927.  
  928.   First, make sure you really have an unsupported sound card. A few
  929.   cards are compatible with supported cards (e.g. Logitech SoundMan 16
  930.   is compatible with ProAudioSpectrum 16). Post your question to the net
  931.   or the Linux activists SOUND channel.
  932.  
  933.   If your card truly is not supported, here are some options:
  934.  
  935.   o  replace it with a supported sound card
  936.  
  937.   o  write the driver yourself
  938.  
  939.   o  ask Hannu Savolainen to add support to the sound driver
  940.  
  941.   The Hacker's Guide to Voxware has some comments on which sound cards
  942.   may be supported in future.
  943.  
  944.  
  945.   5.24.  Is it possible to read and write samples simultaneously?
  946.  
  947.  
  948.   Due to hardware limitations, this is not possible with most sound
  949.   cards. The only supported card that can do this is the
  950.   ProAudioSpectrum16. See the section on "bidirectional mode" in the
  951.   Hacker's Guide to Voxware for more information.
  952.